package model;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class Poll implements Serializable{
	/**
	 * default serial version
	 */
	private static final long serialVersionUID = 1L;
	private int ID;
	private String question;
	private Map<String, Integer> responses;
    
	public Poll(){
		this.setQuestion("");
		this.setResponses(new HashMap<String, Integer>());
	}
	public Poll(String question, Map<String, Integer> responses){
		this.question = question;
		this.responses = responses;
	}
	
	public int getID() {
		return ID;
	}
	public void setID(int iD) {
		ID = iD;
	}
	
	public String getQuestion() {
		return question;
	}
	public void setQuestion(String question) {
		this.question = question;
	}
	public Map<String, Integer> getResponses() {
		return responses;
	}
	public void setResponses(Map<String, Integer> responses) {
		this.responses = responses;
	}
    public void addVote(String response){
    	this.responses.put(response, this.responses.get(response) + 1);
    }
}
